IF exists(SELECT * FROM dbo.sysobjects WHERE name='vulGretaTour' AND xtype='P') 
BEGIN
	DROP PROCEDURE vulGretaTour
END
GO

CREATE  procedure vulGretaTour
as
insert leraars..lokalenVolgorde(lokalen)
select distinct r.hetLokaal  
from leraars..rooster as r 
	left join leraars..LokalenVolgorde as lv 
	on r.hetLokaal = lv.lokalen
where (lv.lokalen is null) 
	and not((r.hetLokaal like 'V%')
	    	     or (r.hetLokaal like 'W%')
			or (r.hetLokaal like 'BPT%'))